<?php
class Plugin_AccessCheck extends Zend_Controller_Plugin_Abstract {
    
   // private $_acl = null;
    
    public function __construct() {
//   //     $this->_acl = $acl;
//        die();
     }
    
    //public function preDispatch(Zend_Controller_Request_Abstract $request) {
    public function preDispatch(Zend_Controller_Request_Abstract $request) {
    	$regLogin = Zend_Registry::get('login');
        echo "..>>>>>";die();
        $module = $request->getModuleName();
        $resource = $request->getControllerName();
        $action = $request->getActionName();
        echo"<br>preDispatch: ";
        echo"<br>module: ";var_dump($module);
        echo"<br>controllador: ";var_dump($resource);
        echo"<br>accion: ";var_dump($action);
       // if(!$this->_acl->isAllowed(Zend_Registry::get('role'), $module.':'.$resource, $action)){
        
        if(!isset($regLogin->usuario)){
       
        $request->setModuleName('users')
                ->setControllerName('login')
                ->setActionName('index');
        }
        //// }
             
    }
}
